<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="prev" href="expat-content-models.html" />
<link rel="parent" href="module-xml.parsers.expat.html" />
<link rel="next" href="module-xml.dom.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>8.5.5 Expat error constants </title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8.5.4 content Model Descriptions"
  href="expat-content-models.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="8.5 xml.parsers.expat  "
  href="module-xml.parsers.expat.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="expat-content-models.html">8.5.4 Content Model Descriptions</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-xml.parsers.expat.html">8.5 xml.parsers.expat  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-xml.dom.html">8.6 xml.dom  </a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h2><a name="SECTION0010550000000000000000"></a><a name="expat-errors"></a>
<br>
8.5.5 Expat error constants 
</h2>

<p>
The following constants are provided in the <code>errors</code> object of
the <tt class="module"><a href="module-xml.parsers.expat.html">xml.parsers.expat</a></tt> module.  These constants are useful
in interpreting some of the attributes of the <tt class="exception">ExpatError</tt>
exception objects raised when an error has occurred.

<p>
The <code>errors</code> object has the following attributes:

<p>
<dl><dt><b><tt>XML_ERROR_ASYNC_ENTITY</tt></b></dt>
<dd>
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF</tt></b></dt>
<dd>
An entity reference in an attribute value referred to an external
entity instead of an internal entity.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_BAD_CHAR_REF</tt></b></dt>
<dd>
A character reference referred to a character which is illegal in XML
(for example, character <code>0</code>, or `<code>&amp;#0;</code>').
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_BINARY_ENTITY_REF</tt></b></dt>
<dd>
An entity reference referred to an entity which was declared with a
notation, so cannot be parsed.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_DUPLICATE_ATTRIBUTE</tt></b></dt>
<dd>
An attribute was used more than once in a start tag.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_INCORRECT_ENCODING</tt></b></dt>
<dd>
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_INVALID_TOKEN</tt></b></dt>
<dd>
Raised when an input byte could not properly be assigned to a
character; for example, a NUL byte (value <code>0</code>) in a UTF-8 input
stream.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_JUNK_AFTER_DOC_ELEMENT</tt></b></dt>
<dd>
Something other than whitespace occurred after the document element.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_MISPLACED_XML_PI</tt></b></dt>
<dd>
An XML declaration was found somewhere other than the start of the
input data.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_NO_ELEMENTS</tt></b></dt>
<dd>
The document contains no elements (XML requires all documents to
contain exactly one top-level element)..
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_NO_MEMORY</tt></b></dt>
<dd>
Expat was not able to allocate memory internally.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_PARAM_ENTITY_REF</tt></b></dt>
<dd>
A parameter entity reference was found where it was not allowed.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_PARTIAL_CHAR</tt></b></dt>
<dd>
An incomplete character was found in the input.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_RECURSIVE_ENTITY_REF</tt></b></dt>
<dd>
An entity reference contained another reference to the same entity;
possibly via a different name, and possibly indirectly.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_SYNTAX</tt></b></dt>
<dd>
Some unspecified syntax error was encountered.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_TAG_MISMATCH</tt></b></dt>
<dd>
An end tag did not match the innermost open start tag.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNCLOSED_TOKEN</tt></b></dt>
<dd>
Some token (such as a start tag) was not closed before the end of the
stream or the next token was encountered.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNDEFINED_ENTITY</tt></b></dt>
<dd>
A reference was made to a entity which was not defined.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNKNOWN_ENCODING</tt></b></dt>
<dd>
The document encoding is not supported by Expat.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNCLOSED_CDATA_SECTION</tt></b></dt>
<dd>
A CDATA marked section was not closed.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_EXTERNAL_ENTITY_HANDLING</tt></b></dt>
<dd>
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_NOT_STANDALONE</tt></b></dt>
<dd>
The parser determined that the document was not ``standalone'' though
it declared itself to be in the XML declaration, and the
<tt class="member">NotStandaloneHandler</tt> was set and returned <code>0</code>.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNEXPECTED_STATE</tt></b></dt>
<dd>
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_ENTITY_DECLARED_IN_PE</tt></b></dt>
<dd>
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_FEATURE_REQUIRES_XML_DTD</tt></b></dt>
<dd>
An operation was requested that requires DTD support to be compiled
in, but Expat was configured without DTD support.  This should never
be reported by a standard build of the <tt class="module">xml.parsers.expat</tt>
module.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING</tt></b></dt>
<dd>
A behavioral change was requested after parsing started that can only
be changed before parsing has started.  This is (currently) only
raised by <tt class="method">UseForeignDTD()</tt>.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNBOUND_PREFIX</tt></b></dt>
<dd>
An undeclared prefix was found when namespace processing was enabled.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_UNDECLARING_PREFIX</tt></b></dt>
<dd>
The document attempted to remove the namespace declaration associated
with a prefix.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_INCOMPLETE_PE</tt></b></dt>
<dd>
A parameter entity contained incomplete markup.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_XML_DECL</tt></b></dt>
<dd>
The document contained no document element at all.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_TEXT_DECL</tt></b></dt>
<dd>
There was an error parsing a text declaration in an external entity.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_PUBLICID</tt></b></dt>
<dd>
Characters were found in the public id that are not allowed.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_SUSPENDED</tt></b></dt>
<dd>
The requested operation was made on a suspended parser, but isn't
allowed.  This includes attempts to provide additional input or to
stop the parser.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_NOT_SUSPENDED</tt></b></dt>
<dd>
An attempt to resume the parser was made when the parser had not been
suspended.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_ABORTED</tt></b></dt>
<dd>
This should not be reported to Python applications.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_FINISHED</tt></b></dt>
<dd>
The requested operation was made on a parser which was finished
parsing input, but isn't allowed.  This includes attempts to provide
additional input or to stop the parser.
</dd></dl>

<p>
<dl><dt><b><tt>XML_ERROR_SUSPEND_PE</tt></b></dt>
<dd>
</dd></dl>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="8.5.4 content Model Descriptions"
  href="expat-content-models.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="8.5 xml.parsers.expat  "
  href="module-xml.parsers.expat.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="8.6 xml.dom  "
  href="module-xml.dom.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="expat-content-models.html">8.5.4 Content Model Descriptions</a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-xml.parsers.expat.html">8.5 xml.parsers.expat  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="module-xml.dom.html">8.6 xml.dom  </a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
